<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="/Public/admin/css/style.css" rel="stylesheet">
<link href="/Public/admin/css/font-awesome.min.css" rel="stylesheet">
<title>{$title}</title>
</head>

<body>
    <div class="breadNav">
        <ul class="breadNavBar">
            <li><i class="icon-home" style="font-size:16px"></i></li>
            <li><a href="javascript:;" onClick="parent.location.reload('/Admin/Index/index');">首页</a></li>
            <li>&gt;</li>
            <li><a href="/Admin/Category/categoryList">题库分类</a></li>
            <li>&gt;</li>
            <li>分类列表</li>
        </ul>
    </div>
    <div style="clear:both;"></div>
	<div class="filter">
		<a href="javascript:history.go(-1);" class="btn btn-primary btn-lg" id="backBtn"><i class="icon-reply"></i>&nbsp;返回</a>
	</div>
    <div class="tableBox">
    <table class="table">
        <thead>
			<tr>
				<th class="w_40">类别名</th>
				<th class="w_20" >类别名</th>
				<th>操作</th>
			</tr>
        </thead>
        <tbody id="dataInfo">
			<tr>
				<td align="left" style="color:#F00">分类目录</td>
				<if condition="$type eq ''">
					<td align="left"><a href="/Admin/Category/addCat/pid/{$pid}" class="btn btn-primary exit"><i class="icon-plus"></i>&nbsp;新增</a>
				<else/>
					<td align="left"><a href="/Admin/Category/addCat/pid/{$pid}/type/{$type}" class="btn btn-primary exit"><i class="icon-plus"></i>&nbsp;新增</a>
				</if>
			</tr>
            <volist name="catList" id="catList">
            <tr class="line_g hover_bg">
                <td align="left">
                <span style="padding-right:0.5em;"></span>
                <img align="absmiddle" src="/Public/admin/images/category/open.png" onClick="menuDisplay(this,'s'+{$categoryList.id});" />
                {$catList.catname}
                </td>
				<td>
					<if condition="$catList.tiliang eq 1">
						<if condition="$catList.type eq 1">
							<a href="/Admin/Question/index/catId/{$catList.id}" class="exit">&nbsp;查看题目</a>
							<elseif condition="$catList.type eq 2"/>
							<a href="/Admin/Exam/index/catId/{$catList.id}" class="exit"></i>&nbsp;查看题目</a>
						</if>
					</if>
					<if condition="$type neq 2">
						<if condition="$catList.status eq 1">
							<a href="/Admin/Category/index/pid/{$catList.id}/type/1" class="exit">&nbsp;章节分类</a>
							<a href="/Admin/Category/index/pid/{$catList.id}/type/2" class="exit">&nbsp;真题分类</a>
							<else/>
							<if condition="$type neq ''">
								<a href="/Admin/Category/index/pid/{$catList.id}/type/{$type}" class="exit">&nbsp;查看下级</a>
								<else/>
								<a href="/Admin/Category/index/pid/{$catList.id}" class="exit">&nbsp;查看下级</a>
							</if>
						</if>
					</if>
				</td>
                <td align="left">
					<a href="/Admin/Category/editCat/id/{$catList.id}" class="btn btn-primary exit"><i class="icon-edit"></i>&nbsp;编辑</a>
                    <a href="/Admin/Category/catDel/id/{$catList.id}" class="btn   exit"><i class="icon-remove"></i>&nbsp;删除</a>
                </td>
            </tr>
            </volist>
        </tbody>
    </table>
    </div>
	<div class="pageBarBox">
		{$page}
	</div>
</body>
<script src="/Public/js/jquery.min.js?ver=1.8.3"></script>
<script src="/Public/admin/js/main.js"></script>
<script src="/Public/js/titleMes.js"></script>
<script>
function SortUp(sortid,id){
	  $.ajax({
		  type:"POST",
		  url:"/Admin/Category/categorySortUp",
		  data:{sortid:sortid,id:id},
		  cache:false,
		  async:false,
		  dataType:"text",
		  beforeSend:function(XMLHttpRequest){
		  },
		  success:function(html) {
				if(html==1){
					 location.replace('/Admin/Category/categoryList');
				}
		  },
		  error:function(XMLHttpRequest, textStatus, errorThrown) {
			  alert('请求异常，请联系管理员!');
		  }
	  }).responseText;	
}
function SortDown(sortid,id){
	  $.ajax({
		  type:"POST",
		  url:"/Admin/Category/categorySortDown",
		  data:{sortid:sortid,id:id},
		  cache:false,
		  async:false,
		  dataType:"text",
		  beforeSend:function(XMLHttpRequest){
		  },
		  success:function(html) {
				if(html==1){
					 location.replace('/Admin/Category/categoryList');
				}
		  },
		  error:function(XMLHttpRequest, textStatus, errorThrown) {
			  alert('请求异常，请联系管理员!');
		  }
	  }).responseText;	
}
function menuDisplay(obj,idval){
	var d=$(obj).attr('alt');
	if($("."+idval).is(":visible")){
		$(obj).attr('src','/Public/admin/images/category/close.png');
		$("."+idval).hide();
	}else{
		$(obj).attr('src','/Public/admin/images/category/open.png');
		$("."+idval).show();		
	}		
}
</script>
</html>
